package com.dy.placeOrder2.controller;



import com.dy.placeOrder2.service.SpeciService;

import com.kaoshi.common.config.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.dy.pojo.Speci;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-11-22
 */
@RestController
@CrossOrigin
@RequestMapping("/speci")
public class SpeciController {

    @Autowired
    private SpeciService speciService;

    //动态获取订单规格信息
    @PostMapping("/all")
    public Result getAllSpeci(@RequestBody Speci speci) {
        Integer id = speci.getId();
        List<Speci> results = speciService.findAll(id); // assuming findAll returns a List
        return Result.ok(results); // 返回列表结果
    }

}
